//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Example #12—String Class Example
// CS 151, 6 Apr 2009
// ECC, Spring 2009
// Niko Culevski
// Program to demonstrate few methods of the String class
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public class Alphabet
{
    public static void main(String[] args)
    {
        String name1 = "Tommy";
        String name2 = "Tommy";
        System.out.println("name1 == name2" + (name1 == name2));
        String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";   //no new
        System.out.println(alphabet);
        System.out.println("This string contains " + alphabet.length()
          + " characters.");
        System.out.println("The character at index 4 is "
          + alphabet.charAt(4));	//letter E, 4 letters before E
        System.out.println("The index of the character Z is "
          + alphabet.indexOf('Z'));	//number of characters that precede Z
        System.out.println("The hash code for this string is "
          + alphabet.hashCode());
    }
}